package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.LogBean;
import com.project.mapper.ILogMapper;
import com.project.service.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
@Service
@Transactional
public class LogServiceImpl implements ILogService {
    @Autowired
    private ILogMapper mapper;

    @Override
    public PageInfo<LogBean> cutByItem(int pageNO, LocalDate startDate, LocalDate endDate) {
        PageHelper.startPage(pageNO,3);
        PageInfo pageInfo = PageInfo.of(mapper.findByItem(startDate,endDate));
        return pageInfo;
    }
}
